const path = require("path"); //引入path模板
function resolve(dir) {
  return path.join(__dirname, dir);
}
module.exports = {
  lintOnSave: false,
  publicPath: "./",
  chainWebpack: (config) => {
    config.resolve.alias
      .set("@", resolve("src")) // key,value自行定义，比如.set('@@', resolve('src/components'))
      .set("components", resolve("src/components"))
      .set("assets", resolve("src/assets"))
      .set("views", resolve("src/views"))
      .set("network", resolve("src/network"));
  },
  devServer: {
    proxy: {
      //解决跨域问题
      "/api": {
        // 此处的写法，目的是为了 将 /api 替换成 https://autumnfish.cn/
        target: "https://wx.diqiu666.com/",
        // 允许跨域
        changeOrigin: true,
        ws: true,
        pathRewrite: {
          "^/api": "",
        },
      },
    },
  },
  css: {
    extract: false
  }

};
